home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / Dots & Pixels / headers / dotcollection.h < prev    next >
C/C++ Source or Header  |  1995-09-29  |  701b  |  39 lines

  1. #pragma once
  2. //
  3. // class dotcollection is used for the rapid appliance of first order optic
  4. // flow. It simply stores a collection of 2D dot positions at 32-bit resolution.
  5. //
  6. class dotcollection
  7. {
  8.     public:
  9.     
  10.         dotcollection( int aantaldots);
  11.  
  12.         ~dotcollection();
  13.  
  14.     protected:
  15.         unsigned int numdots;
  16.         //
  17.         // coordinates of the dots:
  18.         //
  19.         short *xcoords;
  20.         short *ycoords;
  21.         
  22.     private:
  23.         //
  24.         // we use 'short_long_hack' to split an unsigned long in two
  25.         // signed shorts (the unsigned long being returned by randomizer_step())
  26.         //
  27.         typedef struct two_shorts
  28.         {
  29.             short left;
  30.             short right;
  31.         };
  32.         
  33.         typedef union short_long_hack
  34.         {
  35.             two_shorts shorties;
  36.             unsigned long ulong;
  37.         };
  38. };
  39.